<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>宏队列与微队列</title>
</head>

<body>

</body>
<script>
  setTimeout(() => {  // 会立即放入宏队列
    console.log('timeout callback1()');
  }, 0);
  
  setTimeout(() => {  // 会立即放入宏队列
    console.log('timeout callback2()');
  }, 0);

  Promise.resolve(1).then(
    value => {  // 会立即放入微队列
      console.log('Promise onResolved1()', value);
    }
  )
  Promise.resolve(2).then(
    value => {  // 会立即放入微队列
      console.log('Promise onResolved2()', value);
    }
  )



</script>

</html>